package com.atguigu.eduservice.client;

import com.atguigu.commonutils.ordervo.UcenterMemberOrder;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UcenterClientFallbackFactory implements FallbackFactory<UcenterClientService> {

    //出错之后会执行
    @Override
    public UcenterClientService create(Throwable throwable) {
        StackTraceElement[] st_tr = throwable.getStackTrace();
        System.err.println("st_tr[0].toString()" + st_tr[0].toString());
        return new UcenterClientService() {
            @Override
            public UcenterMemberOrder getUserInfo(String id) {
                return null;
            }
        };
    }
}
